home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun: Game Pak / rerun-gamepak / shell game (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  87 lines

  1. 100 rem ye olde shell game by sullivan
  2. 110 def fn d(n)=int(rnd(1)*n)
  3. 120 j=rnd(-ti): a=15
  4. 130 print chr$(14)
  5. 140 goto 440
  6. 150 rem print title
  7. 160 print "[147]" tab(a) "[211][200][197][204][204] [199][193][205][197]" u$
  8. 170 a=15: u$="": return
  9. 180 rem get skill level
  10. 190 poke z,p: print
  11. 200 print tab(10)"[211]kill [204]evel (1-9): ";
  12. 210 gosub 330: b=n: k=120+((9-b)^2)*5
  13. 220 for i=1 to r: next: return
  14. 230 rem delay
  15. 240 for i=1 to k: next: return
  16. 250 rem shell layout
  17. 260 for i=0 to 8
  18. 270 j=int(i/3)
  19. 280 b(i)=1241+80*j+3*(i-j*3)
  20. 290 poke b(i)+c,1
  21. 300 next i
  22. 310 return
  23. 320 rem numeral input
  24. 330 g=1-g
  25. 340 for j=1 to 20
  26. 350 if g=1 then print "";
  27. 360 print "?[157][146]";
  28. 370 get q$
  29. 380 n=val(q$): if n>0 goto 410
  30. 390 next j
  31. 400 goto 330
  32. 410 print "[157]" n ""
  33. 420 return
  34. 430 rem mainline
  35. 440 c=54272: e=160: f=170: r=700
  36. 450 h=1484: z=214: p=8: gosub 160
  37. 460 gosub 190: s=0: p=21
  38. 470 u$=":  [204]evel"+str$(b): a=10
  39. 480 gosub 160: gosub 260: poke c+h,1
  40. 490 u=fn d(9)
  41. 500 v=fn d(9)
  42. 510 if v=u goto 500
  43. 520 w=fn d(9)
  44. 530 if w=u or w=v goto 520
  45. 540 for i=0 to 8
  46. 550 a(i)=e
  47. 560 if i=u or i=v or i=w then a(i)=f
  48. 570 poke b(i),a(i)
  49. 580 next i
  50. 590 for i=1 to h: next
  51. 600 poke b(u),e:poke b(v),e:poke b(w),e
  52. 610 for i=1 to r: next
  53. 620 m=fn d(2)+8
  54. 630 for j=1 to m
  55. 640 x=fn d(9): poke b(x),32
  56. 650 t=a(x): poke h,e: gosub 240
  57. 660 y=fn d(9): if y=x goto 660
  58. 670 poke b(y),32: a(x)=a(y)
  59. 680 for i=1 to 120: next
  60. 690 poke b(x),e: gosub 240
  61. 700 poke h,32: poke b(y),e
  62. 710 a(y)=t: gosub 240
  63. 720 next j
  64. 730 for i=0 to 8
  65. 740 poke b(i),177+i
  66. 750 next i
  67. 760 poke z,11: print
  68. 770 for i=1 to 3
  69. 780 print tab(18) "*[146] = ?"
  70. 790 next i
  71. 800 poke z,11: print
  72. 810 for i=1 to 3
  73. 820 print tab(22);
  74. 830 gosub 330
  75. 840 if a(n-1)>0 goto 860
  76. 850 print "[145][145]";: goto 820
  77. 860 s=s-(a(n-1)=f): a(n-1)=-a(n-1)
  78. 870 next i
  79. 880 for i=0 to 8
  80. 890 if abs(a(i))=f then poke b(i),f
  81. 900 next i
  82. 910 print "" tab(14) s "out of 3!"
  83. 920 print tab(14) "[193][199][193][201][206][160][160]([217]/[206])?";
  84. 930 get q$: if q$="y" goto 460
  85. 940 if q$<>"n" goto 930
  86. 950 gosub 160: print
  87.